/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import org.hibernate.Criteria;
import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class ContractCriteria extends AbstractORMCriteria {
	public final IntegerExpression ID;
	public final StringExpression Number;
	public final StringExpression ClientNif;
	public final StringExpression ClientName;
	public final StringExpression Morada;
	
	public ContractCriteria(Criteria criteria) {
		super(criteria);
		ID = new IntegerExpression("ID", this);
		Number = new StringExpression("Number", this);
		ClientNif = new StringExpression("ClientNif", this);
		ClientName = new StringExpression("ClientName", this);
		Morada = new StringExpression("Morada", this);
	}
	
	public ContractCriteria(PersistentSession session) {
		this(session.createCriteria(Contract.class));
	}
	
	public ContractCriteria() throws PersistentException {
		this(smartgrid.SmartgridPersistentManager.instance().getSession());
	}
	
	public SupplierCriteria createSupplier_roleCriteria() {
		return new SupplierCriteria(createCriteria("supplier_role"));
	}
	
	public TariffCriteria createTariff_CurrentTarif_roleCriteria() {
		return new TariffCriteria(createCriteria("Tariff_CurrentTarif_role"));
	}
	
	public FaceBookAccountCriteria createFaceBookAccount_roleCriteria() {
		return new FaceBookAccountCriteria(createCriteria("ORM_FaceBookAccount_role"));
	}
	
	public TariffCriteria createTariff_PreviusTariffs_roleCriteria() {
		return new TariffCriteria(createCriteria("ORM_Tariff_PreviusTariffs_role"));
	}
	
	public DataLineCriteria createDataLinesCriteria() {
		return new DataLineCriteria(createCriteria("ORM_DataLines"));
	}
	
	public AnnotationCriteria createAnnotationsCriteria() {
		return new AnnotationCriteria(createCriteria("ORM_Annotations"));
	}
	
	public DiaAgregadoCriteria createDiaAgregadosCriteria() {
		return new DiaAgregadoCriteria(createCriteria("ORM_DiaAgregados"));
	}
	
	public MesAgregadoCriteria createMesAgregadosCriteria() {
		return new MesAgregadoCriteria(createCriteria("ORM_MesAgregados"));
	}
	
	public SemanaAgregadaCriteria createSemanaAgregadasCriteria() {
		return new SemanaAgregadaCriteria(createCriteria("ORM_SemanaAgregadas"));
	}
	
	public Contract uniqueContract() {
		return (Contract) super.uniqueResult();
	}
	
	public Contract[] listContract() {
		java.util.List list = super.list();
		return (Contract[]) list.toArray(new Contract[list.size()]);
	}
}

